<?php
//set_time_limit('25');
//Comentado por: Pareira
//ini_set('mysql.connect_timeout','40');
//ini_set('default_socket_timeout','40');

$conecta_banco = mysql_connect('10.54.5.115','webroot','rm970329');
mysql_select_db('rm',$conecta_banco);

//mysql_close($conecta_banco);

/* *** GERA LOG TXT DE ACESSOS ********************************************************************
 *
 * DEVELOPER: MAIQUEL LUI
 * DATA: 2013-12-27 10:58:00
 */
/*
$div = explode('/',$_SERVER['PHP_SELF']);
$cam='';for($i=0,$c=(count($div)-2);$i<$c;$i++){$cam .= '../';}

do{ // VERIFICA SE EXISTE OUTRO ARQUIVO COM MESMO NOME ********************************************
	$a=1;
	$name = rand(10000000000,99999999999).'_'.rand(10000000000,99999999999).'.txt';
	if(!file_exists($cam.'maik/contAcesso/'.$name)){
		$a=0;
	}
}while($a == 1);

$dir = $cam.'maik/contAcesso/'.$name;
$f = fopen($dir,'w');
fputs($f,'/includes/conecta_banco.php'.PHP_EOL.$_SESSION['MATRICULAUSER'].PHP_EOL .$_SERVER['PHP_SELF'].PHP_EOL .$_SERVER['REMOTE_ADDR'].PHP_EOL. 'webroot'.PHP_EOL. session_id());
fclose($f);
*/
// *** FIM GERA LOG *******************************************************************************
